<?php
class Group extends Zend_Db_Table
{
	protected $_name ="group";
	protected $_primary = 'group_id';


 public function getAllGroups(){
          $select = $this->select();
          $select->order('group_id desc');
          return $this->fetchAll($select)->toArray();
    }

 //根据id 查询group
    public function getgroupByid($group_id){
          $select = $this->select();
          $select->where("group_id=".$group_id);
          return $this->fetchAll($select)->toArray();
    }

 //更新group
    public function updategroupByid($array,$group_id){

		$db = $this->getAdapter();
		$where=$db->quoteInto('group_id = ?', $group_id);
		$this->update($array, $where);
                return true;
	}
//删除group
     public function delgroupByid($group_id){
          $where = 'group_id = '. $group_id;
         $this->delete($where);
         return true;
    }

}

